<script type="text/javascript" src="module/mod_kampus/ajax.js"></script>
<div class="span10">
          <div class="row-fluid">
            <div class="span12 box">
                <div class="box-head">
                    <h3> Berita</h3>
                </div>
                <div class="box-content">
                    <div class="content-inner">
                        <div class="marg20-btm">
                        
                            <a href="<?php echo base_url();?>admin/info/add" class="btn btn-primary"><i class="icon-plus"></i> Tambah baru</a>
                            
                            <form class="pull-right form-inline" method="post" action="<?php echo base_url();?>admin/info/search">
                                <input type="text" placeholder="search..." name="judul" />
                                <input type="submit" name="cari" value="Seacrh" class="btn" />
                            </form>
                        </div>
                        
                        <table class="table table-bordered table-striped">
                          <thead>
                              <tr>
                                <!--<th><input type="checkbox" value="" class="check-all" /></th> -->
                                <th>NO</th>
                                <th>Judul</th>
                                <th>Isi Info</th>
                                <th>Tanggal Posting</th>
                                <th>Action</th>
                              </tr>
                            </thead>
                            <tbody>
                            <?php 
							$no=1;	
							foreach($tabel as $r){?>
                              <tr>
                                <!--<td><input type="checkbox" /></td> -->
                                <td><?php echo $no; ?></td>
                                <td><?php echo $r['judul']; ?></a></td>
                                <td><?php echo substr($r['isi'],0,50); ?></td>
                                <td><?php echo $r['tgl']; ?></td>
                                <td><a href="<?php echo base_url();?>admin/info/edit/<?php echo $r['id_info']; ?>" rel="tooltip" title="Edit" class="btn btn-primary"><i class="icon-edit"></i></a>
                                    <a href="<?php echo base_url();?>admin/info/delete/<?php echo $r['id_info']; ?>" rel="tooltip" title="Delete" class="btn btn-danger" onClick="return confirm('Are you sure ?')"><i class="icon-trash"></i></a>
                                    <!--<a href="index.php?module=mod_peta&prev=preview" rel="tooltip" title="View" class="btn btn-success"><i class="icon-eye-open"></i></a> -->
                                </td>
                              </tr>
                            </tbody>
                            <?php 
							$no++;
							}
							 ?>
                          </table>
                          
                          <center>
                          
                            
                              <?php echo $pagination ?> 
                           
                         
                    </div><!-- content-inner -->
                </div>
            </div>
          </div> <!-- end row -->
          
        </div>
		<script>
		$(document).ready(function(){
		$("#searching").change(function(){
			var keyword = $("#searching").val();
			console.log(keyword);
				$.post("<?php echo base_url()?>admin/berita/search", {'keyword': keyword},function(dataFromServer){
					var html = "";
					  html = "<table class='table table-bordered'><tr><th>NIM</th><th>Nama</th><th>Divisi</th></tr>";
					var hasil = eval ("(" + dataFromServer + ")");
					$.each(hasil, function(key,item){
						console.log(key +" : "+item);
						html += "<tr><td>"+item.nim+"</td><td>"+item.nama+"</td><td>"+item.divisi+"</td></tr>"; 
					});            
					html +="</table>";
					$("#hasil").html(html);
				});
		});
		});
		</script>